Skip to content

Convert feature-travel-certificate to a Kotlin Multiplatform module - #3372

Closed
StylianosGakis wants to merge 2 commits into
refactor/common-email-validationfrom
refactor/kmp-feature-travel-certificate
Closed

StylianosGakis wants to merge 2 commits into
refactor/common-email-validationfrom
refactor/kmp-feature-travel-certificate

Conversation

@StylianosGakis

Copy link
Copy Markdown
Member
🤖 AI description

Turns feature-travel-certificate into a Kotlin Multiplatform module (JVM and Android targets) with its keys, five ViewModels, presenters, use cases, deep links and screens in commonMain. Part of making the whole app run on a second platform (desktop). Nothing changes on Android.

Stacked on #3368, which this PR targets, because the email check now calls the commonMain isValidEmail from there.

The first commit is 28 pure renames, including the unit tests moving to jvmTest unchanged. In the second:

  • Screens pass the DownloadedFile up instead of building a java.io.File. The entries file builds the File from the same path and hands it to sharePDF as before, which is why that one file stays in androidMain.
  • validateEmail(x).isSuccessful becomes isValidEmail(x), the same check. Error strings are unchanged.
  • Two previews used java.time.LocalDate.now() fully qualified and now use kotlinx.datetime.

The module now builds for JVM and Android, with its keys, screens,
presenters, ViewModels, use cases and deep link provider in commonMain.
Email validation uses the commonMain isValidEmail, and the history and
overview screens hand the downloaded PDF out as a DownloadedFile.

java.util.Locale in the date input preview becomes previewCommonLocale,
and the history preview reads today's date through kotlinx-datetime.
The unused android.R.attr.enabled import is dropped. Unit tests run as
jvmTest.

TravelCertificateEntries stays in androidMain because sharing the PDF
needs LocalContext and Context.sharePDF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant